package com.spring.boot.email.controller;

import com.spring.boot.email.dto.BaseResult;
import com.spring.boot.email.entity.ReceiveEmail;
import com.spring.boot.email.service.EmailService;
import org.apache.tomcat.util.codec.binary.Base64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.*;
import java.util.Properties;

@RestController
@RequestMapping(value = "email")
public class MailController {
    private static final Logger logger = LoggerFactory.getLogger(MailController.class);
    @Autowired
    private EmailService emailService;

    @RequestMapping(value = "sendHtmlMail", method = RequestMethod.POST)
    public BaseResult sendHtmlMail(HttpServletRequest request, @RequestParam("file") MultipartFile[] file) {
        String emailMessageJson = request.getParameter("emailMessage");
        String mailSenderConfigJson = request.getParameter("mailSenderConfig");
        BaseResult baseResult = emailService.sendHtmlMail(emailMessageJson, mailSenderConfigJson, file);
        return baseResult;
    }

    /**
     * 记录邮件打开的次数
     * @param id
     */
    @RequestMapping(value = "/count/{id}")
    public void count(@PathVariable(name = "id") String id){
        // TODO  记录打开邮件的次数
        System.out.println(id);
    }


    @ResponseBody
    @RequestMapping(value = "receive", method = RequestMethod.GET)
    public BaseResult getEmail(@RequestBody ReceiveEmail receiveEmail) throws Exception {
        return emailService.getEmail(receiveEmail);
    }

//    public static void main(String[] args) throws IOException {
//        String aa = getStr();
//        byte[] bytes = Base64.decodeBase64(aa);
//        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
//        String fileName = "111111.xlsx";
//        copy(byteArrayInputStream, new FileOutputStream("G:\\"+fileName));
//
//    }
//
//    private static String getStr() {
//        String a = "UEsDBBQABgAIAAAAIQDdMR0oagEAAPkEAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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19yZWxzL3NoZWV0MS54bWwucmVsc1BLAQItABQABgAIAAAAIQDLqiaHpAYAAJMaAAATAAAAAAAAAAAAAAAAAFQMAAB4bC90aGVtZS90aGVtZTEueG1sUEsBAi0AFAAGAAgAAAAhAAFwgHjtAQAAegMAABgAAAAAAAAAAAAAAAAAKRMAAHhsL3dvcmtzaGVldHMvc2hlZXQxLnhtbFBLAQItABQABgAIAAAAIQBsxtpMwAIAAGsGAAANAAAAAAAAAAAAAAAAAEwVAAB4bC9zdHlsZXMueG1sUEsBAi0AFAAGAAgAAAAhAK4L/Ym7AQAALBUAACcAAAAAAAAAAAAAAAAANxgAAHhsL3ByaW50ZXJTZXR0aW5ncy9wcmludGVyU2V0dGluZ3MxLmJpblBLAQItABQABgAIAAAAIQBoZLhGDQEAAI0BAAATAAAAAAAAAAAAAAAAADcaAABkb2NQcm9wcy9jdXN0b20ueG1sUEsBAi0AFAAGAAgAAAAhAFlPqN1GAQAAWQIAABEAAAAAAAAAAAAAAAAAfRwAAGRvY1Byb3BzL2NvcmUueG1sUEsBAi0AFAAGAAgAAAAhADpd9BGaAQAAEAMAABAAAAAAAAAAAAAAAAAA+h4AAGRvY1Byb3BzL2FwcC54bWxQSwUGAAAAAAwADAAlAwAAyiEAAAAA";
//        return a;
//    }
//    public static void copy(ByteArrayInputStream is, FileOutputStream os) throws IOException {
//        byte[] bytes = new byte[1024];
//        int len = 0;
//        while ((len=is.read(bytes)) != -1 ) {
//            os.write(bytes, 0, len);
//        }
//        if (os != null)
//            os.close();
//        if (is != null)
//            is.close();
//    }

}

